<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>注册成功</title>
</head>
<body>
<jsp:useBean id="registerBean" scope="request" class="com.example.bean.RegisterBean"/>
<h2>注册成功！</h2>
<p><%=registerBean.getMessage()%></p>
<p>
    <span id="countdown">5</span> 秒后跳转到登录页面...
</p>
<script>
    var countdownElement = document.getElementById("countdown");
    var timeRemaining = 5;

    var timer = setInterval(function() {
        timeRemaining--;
        countdownElement.textContent=timeRemaining; // 更新页面显示的倒计时数字
        if (timeRemaining <= 0) {
            clearInterval(timer);
            window.location.href = 'index.jsp';   // 重定向到登录页面
            return;
        }

    }, 1000);
</script>
</body>
</html>